/*
 * @Author: 姚沈阳 11500793+yao-shenyang@user.noreply.gitee.com
 * @Date: 2023-10-23 18:39:02
 * @LastEditors: 姚沈阳 11500793+yao-shenyang@user.noreply.gitee.com
 * @LastEditTime: 2023-10-24 15:03:58
 * @FilePath: \uni-preset-vue-vite-ts\src\modules\train.ts
 * @Description: 
 * qq1908552310
 */

import { defineStore } from 'pinia';
export const useTrainStore = defineStore('train', {
    state: () => {
        return { count: [] };
    },
    // 也可以这样定义
    // state: () => ({ count: 0 })

    actions: {
        async getTrani(data: any) {
            const result = await uniCloud.callFunction({
                name: "train",
                data
            });
            if (result.result.code == 0) {
                this.count = result.result.data.data
            } else {
                uni.showToast({
                    title: "暂无车次",
                    icon: "error"
                })
                this.count = []
            }
        }
    },

});